package file;

import java.io.File;
import java.io.FileFilter;

public class ListFilesDemo2 {
    public static void main(String[] args) {
        File dir=new File(".");
        if(dir.isDirectory()){
            FileFilter fileFilter=new FileFilter() {
                @Override
                public boolean accept(File f) {
                  return  f.getName().startsWith(".");
                }
            };
            FileFilter f1=(File f)->f.getName().startsWith(".");
            File []subs=dir.listFiles(fileFilter);
            for(File sub:subs)
                System.out.println(sub.getName());
        }
    }
}
